package com.tang.algorithm.array;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/5/15 19:57
 * 136. 只出现一次的数字
 * https://leetcode-cn.com/problems/single-number/
 */
public class LeetCode136 {
    public static void main(String[] args) {
        int[] a = {2,2,1,3,3};
        System.out.println(singleNumber(a));
    }
    public static int singleNumber(int[] nums) {
        int res=0;
        for(int num:nums){
            res ^=num;
        }
        return res;
    }
}
